import { useState } from 'react'
import Child from './Child'
const App = () => {
  const [count, setCount] = useState(0)

  return (
    <div className="app">
      App组件
      <hr />
      <div>
        <p>计数器：{count}</p>
        <button onClick={() => setCount(count + 1)}>+1</button>
        {count < 5 ? <Child></Child> : null}
      </div>
    </div>
  )
}

export default App